package com.lzy.product.service.impl;

import com.lzy.framework.core.utils.DozerUtils;
import com.lzy.product.dao.OrderCouponMapperExt;
import com.lzy.product.dtos.OrderCouponDto;
import com.lzy.product.entity.OrderCoupon;
import com.lzy.product.service.OrderCouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class OrderCouponServiceImpl implements OrderCouponService {
    @Autowired
    OrderCouponMapperExt orderCouponMapperExt;

    @Override
    public Boolean createOrderCoupon(OrderCouponDto dto) {
        OrderCoupon orderCoupon = DozerUtils.map(dto, OrderCoupon.class);
        return orderCouponMapperExt.insertSelective(orderCoupon) > 0;
    }

    @Override
    public List<OrderCouponDto> selectOrderCouponList(OrderCouponDto dto) {
        return orderCouponMapperExt.selectOrderCouponList(dto);
    }
}
